package top.xiangqifu.springboot2.user.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import top.xiangqifu.springboot2.user.base.BaseDataResult;
import top.xiangqifu.springboot2.user.base.BasePageResult;
import top.xiangqifu.springboot2.user.base.PageBean;
import top.xiangqifu.springboot2.user.entity.TbFile;
import top.xiangqifu.springboot2.user.service.FileService;

import java.util.List;

@RestController
@RequestMapping("/user/file")
@RequiredArgsConstructor
@Api(tags = "用户文件上传相关接口")
public class FileUserController {
    private final FileService fileService;

    @ApiOperation(value ="用户上传文件查询",notes = "用户上传文件查询功能接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "fileName",value = "文件描述",dataTypeClass = String.class ,required = true),
            @ApiImplicitParam(name = "info",value = "文件描述",dataTypeClass = String.class ,required = true),
            @ApiImplicitParam(name = "contentType",value = "文件描述",dataTypeClass = String.class ,required = true),
    })
    @GetMapping
    public BasePageResult<List<TbFile>> queryUserFile(TbFile tbFile, PageBean pageBean){
        return fileService.queryUserFile(tbFile,pageBean);
    }
}
